import 'package:json_annotation/json_annotation.dart';

part 'home_list_model.g.dart';

@JsonSerializable()
class HomeTopCardModel {
  @JsonKey(defaultValue: 0)
  int hasHide;
  String? icon;
  String? jumpUrl;
  String type;

  HomeTopCardModel({
    required this.hasHide,
    required this.icon,
    required this.jumpUrl,
    required this.type,
  });

  factory HomeTopCardModel.fromJson(Map<String, dynamic> json) =>
      _$HomeTopCardModelFromJson(json);
  Map<String, dynamic> toJson() => _$HomeTopCardModelToJson(this);
}

@JsonSerializable()
class HomeListModel {
  String name;
  String icon;
  int onlineStatus;
  String? signature;
  String countryFlag;

  @JsonKey(defaultValue: 18)
  int age;

  int sex;
  int personAuth;

  @JsonKey(defaultValue: 0)
  int vistarAuth;

  @JsonKey(defaultValue: 0)
  int showContactFlag;

  HomeListModel({
    required this.name,
    required this.icon,
    required this.onlineStatus,
    required this.vistarAuth,
    this.signature,
    required this.showContactFlag,
    required this.countryFlag,
    required this.age,
    required this.sex,
    required this.personAuth,
  });

  factory HomeListModel.fromJson(Map<String, dynamic> json) =>
      _$HomeListModelFromJson(json);
  Map<String, dynamic> toJson() => _$HomeListModelToJson(this);
}
